package org.fing.edu.uy.esbadp.core.entity;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

import org.fing.edu.uy.esbadp.core.constants.EsbAdpPropertyConstants;


@XmlRootElement(name = EsbAdpPropertyConstants.REQUIREMENTS_ELEMENT_CONDITION)
@XmlAccessorType(XmlAccessType.FIELD)
public class DMAdpServiceRequirementCondition implements Serializable{
	
	private static final long serialVersionUID = 5841934017298223312L;
	
	String type;
	String propName;	
	String operator;
	String serviceMeta;	
	String className;
	
	public DMAdpServiceRequirementCondition(){
		
	}	

	public String getPropName() {
		return propName;
	}

	public void setPropName(String propName) {
		this.propName = propName;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getServiceMeta() {
		return serviceMeta;
	}

	public void setServiceMeta(String serviceMeta) {
		this.serviceMeta = serviceMeta;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("           type:");
		sb.append(type);
		sb.append("\n");
		
		if(type.equalsIgnoreCase(EsbAdpPropertyConstants.REQUIREMENTS_ELEMENT_CONDITION_TYPE_SIMPLE)){
			sb.append("           propName:");
			sb.append(propName);
			sb.append("\n");	
		    sb.append("           operator:");
			sb.append(operator);
			sb.append("\n");
			sb.append("           serviceMeta:");
			sb.append(serviceMeta);
			sb.append("\n");
		}else if (type.equalsIgnoreCase(EsbAdpPropertyConstants.REQUIREMENTS_ELEMENT_CONDITION_TYPE_COMPLEX)) {
			sb.append("           className:");
			sb.append(className);
			sb.append("\n");	
		}
		return sb.toString();	
	}
	
}
